// components/verticalHouseItem/verticalHouseItem.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object,
      value: {}
    },
    index: {
      type: Number,
      value: 0
    },
    type: {
      type: String,
      value: ""
    },
    houseType: {
      type: String,
      value: "new"
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //跳转到详情:
    pushToDetail() {
      let houseNumber = this.properties.data.houseNumber;
      if (this.properties.houseType == "new") {
        wx.navigateTo({
          url: '/newHousePackage/pages/newHouseDetail/newHouseDetail?houseNumber=' + houseNumber,
        })
      } else if (this.properties.houseType == "second") {
        wx.navigateTo({
          url: '/secondHousePackage/pages/secondHouseDetail/secondHouseDetail?houseNumber=' + houseNumber,
        })
      }

    },
    //关注:
    collectNewCerHouse() {
      this.triggerEvent('collectAction', { data: this.properties.data, index: this.properties.index, type: this.properties.type })
    },
  }
})
